<html>
<head><meta charset="utf-8"><title>More existential lifetime use-cases · t-lang · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/index.html">t-lang</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/More.20existential.20lifetime.20use-cases.html">More existential lifetime use-cases</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="237633055"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/More%20existential%20lifetime%20use-cases/near/237633055" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/More.20existential.20lifetime.20use-cases.html#237633055">(May 06 2021 at 09:56)</a>:</h4>
<p>I recall <span class="user-mention" data-user-id="116009">@nikomatsakis</span> saying somewhere recently that they think "existential lifetimes" are the wrong tool and what you really want is "one field that borrows from another field". While that is probably the common case, existential lifetimes are strictly more powerful -- in particular, in the context of <a href="http://plv.mpi-sws.org/rustbelt/ghostcell/"><code>GhostCell</code></a>, the type <code>∃ 'id, (GhostToken&lt;'id&gt;, GhostCell&lt;'id, T&gt;</code> would be a really useful one, and this cannot be expressed with "borrows of a field". <a href="https://gitlab.mpi-sws.org/FP/ghostcell/-/issues/3">https://gitlab.mpi-sws.org/FP/ghostcell/-/issues/3</a> also brings up a usecase where this could help.</p>
<p>I don't remember where Niko said this though, so I'm just throwing this out there in the hope it can become part of the discussion. ;)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>